/**
 * @version 3 11 February 2013
 * @author Myhaylo Kotsyurua
 */

public class AnswerMap {

    private int[] map;
    private int score;
    
    public AnswerMap(int size) {
        this.map = new int[size];
        for (int index = 0; index < size; index++){
            map[index] = 0;
        }
        setScore(0);
    }
    
    public int getSize() {
        return map.length;
    }

    public int getScore() {
        return score;
    }

    public int getQuantityCommonElements(AnswerMap answerMap) {
        int quantityCommonElements = 0;
        for (int index = 0; index < this.map.length; index++) {
            if (this.map[index] == answerMap.map[index]) {
                quantityCommonElements++;
            }
        }
        return quantityCommonElements;
    }

    public void setField(int index, int value) {
        map[index] = value;
    }

    public void setScore(int score) {
        this.score = score;
    }
}
